const express =require('express');
const app = express();
const routes =require('./routes/')
const port = 3000;

// 注意配置body-parser一定要在挂载路由之前
const bodyParser =require('body-parser') // 解析参数模块
// parse application/x-www-form-urlencoded
app.use(bodyParser.urlencoded({ extended: false }))
// parse application/json
app.use(bodyParser.json())

// 把router挂载到app服务中
routes(app)

app.listen(port,function (){
	console.log('server is running at 3000 port')
})